// Fill out your copyright notice in the Description page of Project Settings.


#include "Character2D/Core/RuleCharacter2D.h"

#include "Components/ArrowComponent.h"
#include "Components/BoxComponent.h"
#include "Components/WidgetComponent.h"

ARuleCharacter2D::ARuleCharacter2D()
{
	HomingPoint = CreateDefaultSubobject<USceneComponent>(TEXT("HomingPoint"));
	Widget = CreateDefaultSubobject<UWidgetComponent>(TEXT("Widget"));
	OpenFirePoint = CreateDefaultSubobject<UArrowComponent>(TEXT("FirePoint"));
	TraceShowCharacterInformation = CreateDefaultSubobject<UBoxComponent>(TEXT("traceBox"));

	HomingPoint->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	Widget->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	OpenFirePoint->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
	TraceShowCharacterInformation->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);

	TraceShowCharacterInformation->SetBoxExtent(FVector(38.f, 38.f, 100.f));
	TraceShowCharacterInformation->SetCollisionProfileName(TEXT("Scanning"));
	
}

void ARuleCharacter2D::Tick(float DeltaSeconds)
{
	Super::Tick(DeltaSeconds);
}

void ARuleCharacter2D::BeginPlay()
{
	Super::BeginPlay();
}

float ARuleCharacter2D::TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
	return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
}

bool ARuleCharacter2D::IsDeath()
{
	return false;
}

float ARuleCharacter2D::GetHealth()
{
	return 0.0f;
}

float ARuleCharacter2D::GetMaxHealth()
{
	return 0.0f;
}

bool ARuleCharacter2D::IsTeam()
{
	return false;
}

EGameCharacterType::Type ARuleCharacter2D::GetType()
{
	return EGameCharacterType::MAX;
}


